<?php

use Illuminate\Http\Request;
use App\Dog;

/*
   |--------------------------------------------------------------------------
   | Application Routes
   |--------------------------------------------------------------------------
   |
   | Here is where you can register all of the routes for an application.
   | It's a breeze. Simply tell Laravel the URIs it should respond to
   | and give it the controller to call when that URI is requested.
   |
 */

Route::get('/', function () {
    return view('welcome');
});

Route::get('ruta', function () {
    return view('lol');
});

Route::get('nuevo-perrito', function () {
    return view('nuevo-perrito');
});

Route::get('guardar-chato', function () {
    $dog = new Dog;
    $dog->name = 'Chato';
    $dog->save();
});

Route::post('nuevo', function (Request $request) {
    $dog = new Dog;
    $dog->name = $request->name;
    $dog->save();
});
